<?php
class UserDao extends DAO {
	
	public  function percist($user){
		$query = "INSERT INTO user VALUES (".$user->getEmail().",".$user->getPass().";";	
	}
	
	public  function query($user) {
		
		if(!($user instanceof User)) {
			return false;	
		}
		
		$rest = false;
		
		$query = "SELECT COUNT(*) FROM user WHERE email = '" . $user->getEmail() .
		         "' AND password = '" . $user->getPass() . "'";
			
		if ($this->database->connect()) {

			$result = $this->database->query($query);
						
			if ($result) {
				
				$result = mysql_fetch_array($result);

				if($result[0] == 1) {

					$rest = true;
				}
			}
		}
		
		return $rest;
	}
	
	public function persist($object) {
		
	}
	
	public function update($object) {
		
	}
	
	public function delete($object) {
		
	}
}	
?>